<?php

declare(strict_types=1);

namespace owns\interface;

use think\Model;

/**
 * 数据库模型
 */
abstract class OwnsModelInteface extends Model
{
    protected $createTime = 'created_at';

    protected $updateTime = 'updated_at';

    /**
     * 条件查询
     * @param object $query
     * @param array $param
     */
    abstract function scopeCustom(object $query, array $param);

    /**
     * 分页
     * @param object $query
     * @param array $param
     */
    public function scopePages($query, array $param)
    {
        $query->page($param['page'], $param['pageSize']);
    }
}
